package com.addplus.townmall.server.api.service.web.knowledgeModule;

import com.addplus.townmall.server.api.model.exam.AutoPaperQuestionNum;
import com.addplus.townmall.server.api.model.exam.Knowledge;
import com.addplus.townmall.server.api.model.exam.KnowledgeExpand;
import com.addplus.townmall.server.api.model.exam.Question;
import com.baomidou.mybatisplus.core.metadata.IPage;

import java.util.List;

public interface KnowledgeService {

    /**
     * 方法描述：查询前三层的数据
     *
     * @param pageNo
     * @param pageSize
     * @return
     * @throws Exception
     */
    IPage getKnowledgeByPage(Integer pageNo, Integer pageSize) throws Exception;

    /**
     * 方法描述：根据id删除数据
     *
     * @param id
     * @return
     * @throws Exception
     */
    Boolean deleteKnowledgeById(Integer id) throws Exception;

    Knowledge getKnowledgeById(Integer id) throws Exception;

    /**
     * 方法描述：通过名字模糊查询数据
     *
     * @param name
     * @param pageNo
     * @param pageSize
     * @return
     * @throws Exception
     */
    IPage<KnowledgeExpand> getKnowledgeByName(String name, Integer pageNo, Integer pageSize) throws Exception;

    /**
     * 方法描述：更新一条数据
     *
     * @param knowledge
     * @return
     * @throws Exception
     */
    Boolean updateKnowledgeById(Knowledge knowledge) throws Exception;

    /**
     * 方法描述：添加一条数据
     *
     * @param area
     * @return
     * @throws Exception
     */
    Knowledge addKnowledge(Knowledge area) throws Exception;

    IPage<Knowledge> getKnowledgeParentByPage(Integer pageNo, Integer pageSize) throws Exception;

    /**
     * 方法描述：通过pid加载孩子，只要获取孩子的id，name
     *
     * @param pid
     * @return
     * @throws Exception
     */
    List<KnowledgeExpand> getKnowledgeByPid(Integer pid) throws Exception;

    /**
     * 方法描述：通过pid加载孩子,只要加载第四层孩子的数据
     *
     * @param pid
     * @return
     * @throws Exception
     */
    List<KnowledgeExpand> getKnowledgeListByPid(Integer pid) throws Exception;

    /**
     * 获取省市两级列表
     * @return
     * @throws Exception
     */
    List<KnowledgeExpand> getKnowledgeExpand () throws Exception;

    List<KnowledgeExpand> getKnowledgeList()throws Exception;


    AutoPaperQuestionNum getAutoPaperQuestionNumByDifficulty(String difficult,String knowledgeName)throws Exception;

}
